package com.zhiyi.coco.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {
    /**
     * 默认打开的页面
     * @return
     */
    @GetMapping("/a")
    public String index(){
        return "gallery";
    }

    /**
     * 帮助跳转页面
     * @param viewName
     * @return
     */
    @RequestMapping("to/{name}")
    public  String to(@PathVariable("name") String viewName){
        return viewName;
    }
}
